#ifndef __DBHANDLER_HEADER
#define __DBHANDLER_HEADER

#include <mysql/mysql.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

class DbHandler {
private:
	MYSQL *handler;
public:
	// 连接MYSQL
	// 使用默认参数
	DbHandler();
	~DbHandler();
	bool connect();
	bool connect(const char *host, 
			const char *user, const char *passwd, 
			const char *db, unsigned int port, 
			const char *unix_socket, unsigned long client_flag);
	
	bool insert_access_record(const char *addr);
	//bool insert_submit_record();

};

#endif // __DBHANDLER_HEADER
